def decrypt(key,e_message):
    translated=""
    e_message=e_message.upper()
    nkey=modreverse(key,26)
    for ch in e_message:
        offset=ord(ch)-65
        translated=translated+chr(((nkey*offset)%26)+65)
    return translated


def exgcd(a,b):
    if b==0:
        return 1,0,a
    else:
        x,y,q=exgcd(b,a%b)
        x,y=y,(x-(a//b)*y)
        return x,y,q
def modreverse(a,p):
    x,y,q=exgcd(a,p)
    if q!=1:
        raise Exception("no,solution")
    else:
        return (x+p)%p

print(decrypt(9,"LKVVWQWXVB"))




